-
Notifications
You must be signed in to change notification settings - Fork 12
[BW-764] Use AuthSession for Communication #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ): Promise<RPCResponseMessage> { | ||
| const { type, scheme } = wallet; | ||
|
|
||
| if (type === 'webBased') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can this just be web?
packages/client/src/MWPClient.ts
Outdated
| const AVAILABLE_CHAINS_STORAGE_KEY = 'availableChains'; | ||
| const WALLET_CAPABILITIES_STORAGE_KEY = 'walletCapabilities'; | ||
| import * as Communicator from './components/communicator'; | ||
| import * as Communicator from './components/communication'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, can we just import postRequestToWallet directly?
| @@ -1,2 +1 @@ | |||
| export * from './handleResponse'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this barrel file. Not great for tree shaking
|
|
||
| provider = new EIP1193Provider({ | ||
| metadata: { appName: 'Test App', appDeeplinkUrl: 'test://deeplink' }, | ||
| metadata: { appName: 'Test App', appCustomScheme: 'test://deeplink' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're publishing a new version do we really need the app prefix on these vars?
can we just same name, scheme, etc...? feels a tad verbose
| appName: string; | ||
| appLogoUrl?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the scw client expect this naming still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, scw client is expecting app prefix from both web sdk and mobile sdk, so keeping it like this for simplicity
packages/client/src/MWPClient.ts
Outdated
| const AVAILABLE_CHAINS_STORAGE_KEY = 'availableChains'; | ||
| const WALLET_CAPABILITIES_STORAGE_KEY = 'walletCapabilities'; | ||
| import * as Communicator from './components/communicator'; | ||
| import * as Communicator from './components/communication/postRequestToWallet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import * as Communicator from './components/communication/postRequestToWallet'; | |
| import { postRequestToWallet } from './components/communication/postRequestToWallet'; |
Summary
We decided to switch over to AuthSession for many benefits including shared cookies w standalone browser, more reliable deeplinking via custom scheme, etc.
This PR:
openAuthSessionAsyncappDeeplinkUrlfromAppMetadataappCustomSchemeis now required inAppMetadatahandleResponseas this is now handled by Expo and consumer won't need to handle response URL manually1.0.0for next releaseHow did you test your changes?
Screen.Recording.2024-12-03.at.3.03.22.PM.mov
Screen.Recording.2024-12-03.at.3.14.05.PM.mov